package com.sun.create;

public class NewRunnable implements Runnable {
	private String name;

	public NewRunnable(String name) {
		this.name = name;
	}

	public void run() {
		for (int i = 0; i < 5; i++) {
			System.out.println(name + "运行  :  " + i);
			try {
				 Thread.sleep((int) Math.random() * 10);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	public static void main(String args[]) {
		new Thread(new NewRunnable("A")).start();
		new Thread(new NewRunnable("B")).start();
	}
}
